#通过key查询
dict1 ={'name':'张三','age':18,'sex':'男'}
# print(dict1['sex'])
# print(dict1['height'])

#通过get查询
# dict.get(key,default=None)
print(dict1.get('name'))
print(dict1.get('tel'))   #key不存在就会返回默认值None
print(dict1.get('tel',180))
